package com.dkm.ec.home.repository.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.repository.AbstractRepository;
import com.dkm.ec.home.domain.HomeAnswer;
import com.dkm.ec.home.persistence.dao.HomeAnswerQueryDao;
import com.dkm.ec.home.persistence.entity.HomeAnswerPo;
import com.dkm.ec.home.repository.HomeAnswerRepository;

/**
 * 对象功能:skg_home_answer Repository接口的实现类
 * 开发公司:SKG.COM
 * 开发人员:喻永淼
 * 创建时间:2015-01-07 10:39:31
 */
@Repository
public class HomeAnswerRepositoryImpl extends AbstractRepository<String, HomeAnswerPo,HomeAnswer> implements HomeAnswerRepository{
	  
	@Resource
	private  HomeAnswerQueryDao homeAnswerQueryDao;

	public HomeAnswer newInstance() {
		HomeAnswerPo po = new HomeAnswerPo();
		HomeAnswer homeAnswer = SpringHelper.getBean(HomeAnswer.class);
		homeAnswer.setData(po);
		return homeAnswer;
	}

	public HomeAnswer newInstance(HomeAnswerPo po) {
		HomeAnswer homeAnswer = SpringHelper.getBean(HomeAnswer.class);
		homeAnswer.setData(po);
		homeAnswer.loadRels();
		return homeAnswer;
	} 
	
	@Override
	protected IQueryDao<String, HomeAnswerPo> getQueryDao() {
		return homeAnswerQueryDao;
	}
	
	public List<HomeAnswerPo> findByQaId(String qaId){
		return homeAnswerQueryDao.findByQaId(qaId);
	}
	
}
